# "脚本处理"


class Statement:
    "脚本语句"

    def __init__(self, content):
        words = content.split(sep=" ")
        self.cmd = words[0]
        self.params = words[1:]

    @property
    def cmd(self):
        "指令"
        return self._cmd
    
    @cmd.setter
    def cmd(self, cmd):
        self._cmd = cmd

    @property
    def params(self):
        "参数 params"
        return self._params

    @params.setter
    def params(self, params):
        self._params = params


def to_lines(txt: str):
    "分割脚本"
    lines = txt.splitlines()
    return lines


def to_statements(lines):
    "转化为语句"
    statements = []
    for i, line in enumerate(lines):
        statements[i] = Statement(line)
    return statements
